//
//  STDiccoverMainHeaderView.swift
//  STMusic
//
//  Created by stoneobs on 16/10/25.
//  Copyright © 2016年 stoneobs. All rights reserved.
//

import UIKit
//主要headerview
class STDiccoverMainHeaderView: UICollectionReusableView {
    var iconButton:STButton!
     var whiteView:UIView!
    var nameLable:STLabel!
    var timeLable:STLabel!
     var dicLable:TTTAttributedLabel!
    override init(frame: CGRect) {
        super.init(frame: frame)
        initSubview()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    func initSubview() {
        self.whiteView = UIView.init(frame: .init(x: 0, y: 40, width: SCREEN_WIDTH - 14, height: 110));
        self.whiteView.backgroundColor = .white;
        self.addSubview(self.whiteView);
        
        self.iconButton = STButton.init(frame: .init(x: self.whiteView.left, y: 20, width: 40, height: 40), title: "", titleColor: GREEN_COLOR, titleFont: 13, cornerRadius: 20, backgroundColor: .white, backgroundImage: UIImage.init(named: "9"), image: nil);
        self.addSubview(self.iconButton);
        
        self.nameLable = STLabel.init(frame: .init(x: iconButton.right+3, y: iconButton.top, width: 140, height: 14), text: "Imusic", textColor: GREEN_COLOR, font: 13, isSizetoFit: true, textAlignment: .left);
        self.addSubview(self.nameLable);
        
        let shareLabel = STLabel.init(frame: .init(x: nameLable.right+4, y: nameLable.top, width: 60, height: 12), text: "分享音乐", textColor: SecendTextColor, font: 12, isSizetoFit: true, textAlignment: .left);
        self.addSubview(shareLabel!);
        
        self.timeLable = STLabel.init(frame: .init(x: self.whiteView.right - 100, y: nameLable.top, width: 98, height: 13), text: "3小时前", textColor: SecendTextColor, font: 11, isSizetoFit: false, textAlignment: .right);
        self.addSubview(self.timeLable);
        
        self.dicLable = TTTAttributedLabel.init(frame: .init(x: 15, y: 25, width: SCREEN_WIDTH-20-30, height: 80));
        self.dicLable.font = Font14;
        self.dicLable.textColor = FirstTextColor;
        self.dicLable.numberOfLines = 0;
        self.dicLable.verticalAlignment = .top;
        self.dicLable.text = "因为数组字面量中的所有值具有相同的类型,Swift可以推断出shoppingList变量的类型...从字典中删除键值对也可以使用removeValueForKey函数。如果该键值对存在,该函数就...";
        self.whiteView.addSubview(self.dicLable);
        
        
        
    }
}
